class Solution(object):
    def combine(self, n, k): # 移除类型提示
        result = []

        def backtrack(current_combination, start_num): # 移除类型提示
            if len(current_combination) == k:
                result.append(list(current_combination))
                return

            if (n - start_num + 1) < (k - len(current_combination)):
                return

            for num in range(start_num, n + 1):
                current_combination.append(num)
                backtrack(current_combination, num + 1)
                current_combination.pop()

        backtrack([], 1)
        return result